﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 系统设置
{
    public partial class TestParaSet : Form
    {
        carinfor.equipmentConfigInfdata equipconfig = new carinfor.equipmentConfigInfdata();
        carinfor.configIni configini = new carinfor.configIni();
        public TestParaSet()
        {
            InitializeComponent();
        }

        private void TestParaSet_Load(object sender, EventArgs e)
        {
            equipconfig = configini.getEquipConfigIni();
            comboBoxDriverScreen.SelectedIndex = equipconfig.DriverDisplay;
            comboBoxDisplayMethod.Text = equipconfig.DisplayMethod;
            comboBoxDriveFbl.SelectedIndex = equipconfig.DriverFbl;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            carinfor.equipmentConfigInfdata equipconfigtosave = new carinfor.equipmentConfigInfdata().CopyFrom(equipconfig);
            equipconfigtosave.DisplayMethod = comboBoxDisplayMethod.Text;
            equipconfigtosave.DriverDisplay = comboBoxDriverScreen.SelectedIndex;
            equipconfigtosave.DriverFbl = comboBoxDriveFbl.SelectedIndex;
            settingform.saveLog("检测配置参数", equipconfig, equipconfigtosave);
            if (configini.writeEquipmentConfig(equipconfigtosave))
                MessageBox.Show("保存成功.", "系统提示");
            else
                MessageBox.Show("数据输入有误,请检查.", "未成功保存");
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }
    }
}
